package com.example.schoolhelp.activity;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.LinearLayout;

import com.example.schoolhelp.R;
import com.example.schoolhelp.base.BaseActivity;
import com.example.schoolhelp.util.BitmapUtil;
import com.example.schoolhelp.view.MyToast;

/**
 * Created by Administrator on 2017/7/15.
 */
public class LoginActivity extends BaseActivity {
    LinearLayout parentLayout;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);
        parentLayout = (LinearLayout) findViewById(R.id.login_parentLayout);

        Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.bg);
        Bitmap bitmap1 = BitmapUtil.blurBitmap(bitmap, this);
        parentLayout.setBackground(new BitmapDrawable(bitmap1));
        }

public void login(View view) {
        Intent intent = new Intent(this, MainActivity.class);
        startActivity(intent);
        MyToast.showToast(this, "登录测试", 2000);
        finish();
        }

public void register(View view) {
        MyToast.showToast(this, " 测试", 2000);
        }

public void visitorLogin(View view) {
        Intent intent = new Intent(this, MainActivity.class);
        startActivity(intent);
        finish();
        }

public void qqLogin(View view) {
        MyToast.showErrorToast(this, " 错误测试", 2000);

        }
        }
